package com.king01.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.king01.dao.OutStaffDao;
import com.king01.dao.StaffDao;
import com.king01.entity.OutStaff;
import com.king01.entity.Staff;
import com.king01.service.OutStaffService;
import com.king01.vo.OutStaffVo;
import com.king01.vo.Result;
import com.king01.vo.StaffVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpSession;
import java.util.List;

@Service
public class OutStaffServiceImpl implements OutStaffService {
    @Autowired
    private OutStaffDao outStaffDao;
    @Autowired
    private HttpSession session;

    @Override
    public Result findAll(Integer current, Integer pageSize, OutStaffVo outStaffVo) {
        OutStaff outstaff = (OutStaff) session.getAttribute("outstaff");
        PageHelper.startPage(current,pageSize);

        List<OutStaff> list = outStaffDao.findAll(outStaffVo);
        PageInfo<OutStaff> pageInfo = new PageInfo<OutStaff>(list);
        return new Result(200,"查询成功",pageInfo);

    }
}